package com.app.sgd.mail;

public class LaunchMail extends EnvioMail implements Runnable {
	private Thread launchMailThread = null;

	public LaunchMail(String host,String subject, String message, String emailFrom, String[] emailTo) {
		super();
		super.setHost(host);
		super.setSubject(subject);
		super.setMessage(message);
		super.setEmailFrom(emailFrom);
		super.setEmailTo(emailTo);
		launchMailThread = new Thread(this, "launchMailThread");
		launchMailThread.start();
	}

	public LaunchMail(String host,String subject, String message, String emailFrom, String[] emailTo, String[] emailCc) {
		super();
		super.setHost(host);
		super.setSubject(subject);
		super.setMessage(message);
		super.setEmailFrom(emailFrom);
		super.setEmailTo(emailTo);
		super.setEmailCc(emailCc);
		launchMailThread = new Thread(this, "launchMailThread");
		launchMailThread.start();
	}

	public void run() {
		try {
			super.sendTextEmail();
		}catch (Exception e) {
			System.out.println("Error al lanzar el thread");
		}
	}

	public static void main(String[] arg) {
	}
}
